package org.hughie.api;

import org.hughie.model.FundSearchResult;
import org.hughie.model.fmn.BaseFundInfoFMN;
import org.hughie.model.fmn.NavFMN;
import org.hughie.model.fmn.PositionInfoFMN;

/**
 * @author hughie.cheng
 * @date 2024/2/28
 */
public enum FundApisMapping implements IRequestMapping {
    FUND_BASE_INFO("https://fundmobapi.eastmoney.com/FundMApi/FundBaseTypeInformation.ashx?FCODE=%s&deviceid=Wap&plat=Wap&product=EFund&version=2.0.0&Uid=&_=%s", "基本信息", BaseFundInfoFMN.class),

    FUND_RANK_LIST("https://fundmobapi.eastmoney.com/FundMNewApi/FundMNRankNewList?callback=jQuery31107515255565108201_1709789565825&fundtype=0&SortColumn=RZDF&Sort=desc&pageIndex=%s&pagesize=%s&companyid=&deviceid=1234567.py.service&plat=Wap&product=EFund&version=2.0.0&Uid=&_=%s", "基金列表", BaseFundInfoFMN.class),
    FUND_SEARCH_LIST("https://fundsuggest.eastmoney.com/FundSearch/api/FundSearchPageAPI.ashx?callback=jQuery18309477310144151805_1709861384435&m=1&key=%s&pageindex=0&pagesize=500&_=%s", "基金列表", FundSearchResult.class),
    FUND_POSITION_INFO("https://fundmobapi.eastmoney.com/FundMNewApi/FundMNInverstPosition?FCODE=%s&deviceid=Wap&plat=Wap&product=EFund&version=2.0.0&Uid=&_=%s", "基金持仓信息", PositionInfoFMN.class),
    FUND_HISTORY_NAV("https://fundmobapi.eastmoney.com/FundMApi/FundNetDiagram.ashx?FCODE=%s&RANGE=%s&deviceid=Wap&plat=Wap&product=EFund&version=2.0.0&_=%s", "历史净值", NavFMN.class)
    ;
    private String url;

    private String desc;

    private Class<?> clz;


    FundApisMapping(String url, String desc, Class<?> clz) {
        this.url = url;
        this.desc = desc;
        this.clz = clz;
    }

    @Override
    public String getUrl() {
        return this.url;
    }

    @Override
    public Class<?> getClz() {
        return this.clz;
    }
}
